package com.wva.video.controller;

import com.wva.common.annotation.authority.Open;
import com.wva.common.utils.R;
import com.wva.video.domain.dto.VideoSearchDTO;
import com.wva.video.domain.vo.VideoSearchVO;
import com.wva.video.service.VideoSearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: hong
 * @Date: 2025/2/16 00:00:24
 */
@Api(tags = "视频搜索相关接口")
@RequestMapping("/video/search")
@RestController
@Open
public class SearchController {
    @Autowired
    VideoSearchService videoSearchService;

    @ApiOperation("视频搜索")
    @GetMapping
    R<VideoSearchVO> videoSearch(@Validated VideoSearchDTO videoSearchDTO) {
        VideoSearchVO videoSearchVO = videoSearchService.search(videoSearchDTO);
        return R.ok(videoSearchVO);
    }
}
